package quanquan.online.dao.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import quanquan.online.bean.UserBean;
import quanquan.online.dao.IUserDao;

public class UserDaoImpl extends HibernateDaoSupport implements IUserDao {

	public void addUser(UserBean userBean) {
		try {
			
			this.getHibernateTemplate().save(userBean);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public UserBean getUserInfo(int id) {
			UserBean use = null;
		try {
			use = (UserBean) this.getHibernateTemplate().get(UserBean.class, id);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		
		return use;
	}

	public void updateUser(UserBean userBean) {
		this.getHibernateTemplate().update(userBean);
	}
}
